<template>
    <div class="body_background" :style="GetWindowBackground">
        <div class="body_background padding-top10">
            <div class="block-box">
                <div class="title-box">
                    <div class="big-font-size three-color">员工信息</div>
                    <img src="../../assets/img/personal.png">
                </div>
                <ul class="create-box">
                    <li>
                        <div class="big-font-size main-color supplier-title white-space">员工姓名：</div>
                        <div class="three-color">刘啊丹</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color supplier-title white-space">登录手机：</div>
                        <div class="three-color">15222222222</div>
                    </li>
                </ul>
            </div>
            <div class="block-box items-start">
                <div class="big-font-size three-color">岗位信息</div>
                <ul class="create-box">
                    <li>
                        <div class="big-font-size main-color supplier-title white-space">所属部门：</div>
                        <div class="three-color">烫卤局总店</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color supplier-title white-space">所属岗位：</div>
                        <div class="three-color">厨师长</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color supplier-title white-space">创&nbsp;建&nbsp;人&nbsp;：</div>
                        <div class="three-color">张飒</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color supplier-title white-space">创建时间：</div>
                        <div class="three-color">2021-11-20 12：12：:1</div>
                    </li>
                </ul>
            </div>

            <div class="button-box">
                <mt-button class="width40 middle-font-size"
                           @click="deleteStaffFun"
                >移除</mt-button>
                <mt-button class="width40 middle-font-size background white-color"
                           @click="editStaffFun"
                >编辑</mt-button>
            </div>
        </div>
    </div>
</template>

<script>

    export default {
        name: "StaffDetail",
        data() {
            return {
                id: '',
                GetWindowBackground: {
                    'min-height': ''
                },
            }
        },
        mounted() {
            this.id = this.$route.query.id;
            console.log(this.id)
        },
        methods: {
            //查看更多订单
            lookMoreOrder(item) {
                this.goodsShow = !this.goodsShow
            },
            //移除
            deleteStaffFun(item) {
                this.$router.push('/StaffManage')
            },
            //编辑
            editStaffFun(item) {
                this.$router.push('/StaffCreate?id=' + this.id)
            },
            getBodyHeight() {
                // 获取浏览器高度，减去顶部搜索栏和导航栏的值 55 + 50（可动态获取）,再减去底部高度值60
                this.GetWindowBackground['min-height'] = window.innerHeight + 'px'
            },
        },
        // 生命周期 - 创建完成（可以访问当前this实例）
        created() {
            window.addEventListener('resize', this.getBodyHeight) // 注册监听器
            this.getBodyHeight() // 页面创建时先调用一次
        },
        // 生命周期 - 销毁完成
        destroyed() {
            window.removeEventListener('resize', this.getBodyHeight)
        },
    }
</script>

<style lang="scss" scoped>

    .padding-top10 {
        padding-top: 15px;
    }

    .block-box {
        width: calc(100% - 60px);
        padding: 20px;
        border-radius: 8px;
        margin-bottom: 15px;
    }


    .title-box{
        width: 100%;
        display: flex;
        justify-content: space-between;
        img{
            width: 28px;
        }
    }

    .create-box {
        width: 100%;
        padding-bottom: 10px;
        padding-top: 10px;
        li {
            width: 100%;
            display: flex;
            padding: 10px 0;
            .supplier-title {
                width: 75px;
                text-align: right;
            }
            .three-color {
                width: calc(100% - 100px);
                text-align: left;
            }
        }
    }

    .button-box {
        width: 100%;
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 45px;
        .width40 {
            width: 40%;
            border: 1px solid #05c569;
            color: #05c569;
            border-radius: 10px;
        }
    }


</style>